PHP BASICS WITH PRACTICAL EXAMPLES AND PROJECT WITH SOURCE CODE by Sahay Dipti

PHP BASICS WITH PRACTICAL EXAMPLES AND PROJECT WITH SOURCE CODE by Sahay Dipti

Author:Sahay, Dipti [Sahay, Dipti]
Language: eng
Format: epub
Publisher: UNKNOWN
Published: 2021-08-22T00:00:00+00:00


CHAPTER 14 Server Side Validation::

When we submit a form the form should be validated.This means we should apply a rule to check that the mandatory fields are not empty and the value entered is in correct type.

For the above form we will add an action in process.php

if(isset($_POST['submit']))

{

if($_POST['name']!='' &&

$_POST['number']!='' && $_POST['email'])

{

code to be executed }

else

{

redirect to previous page }

}

The code above checks if the fields contain some value or not.If the value is not set for any field then the guest gets

redirected to the form page.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.